<!doctype html>
<html class="no-js" lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>
    
  【精选】Mac 手动内存清理教程 - kaelinda
  
  </title>
  
  
  <link href="atom.xml" rel="alternate" title="kaelinda" type="application/atom+xml">
    <link rel="stylesheet" href="asset/css/foundation.min.css" />
    <link rel="stylesheet" href="asset/css/docs.css" />
    <script src="asset/js/vendor/modernizr.js"></script>
    <script src="asset/js/vendor/jquery.js"></script>
  <script src="asset/highlightjs/highlight.pack.js"></script>
  <link href="asset/highlightjs/styles/github.css" media="screen, projection" rel="stylesheet" type="text/css">
  <script>hljs.initHighlightingOnLoad();</script>
<script type="text/javascript">
  function before_search(){
    var searchVal = 'site:kaelinda.top ' + document.getElementById('search_input').value;
    document.getElementById('search_q').value = searchVal;
    return true;
  }
</script>
  </head>
  <body class="antialiased hide-extras">
    
    <div class="marketing off-canvas-wrap" data-offcanvas>
      <div class="inner-wrap">


<nav class="top-bar docs-bar hide-for-small" data-topbar>


  <section class="top-bar-section">
  <div class="row">
      <div style="position: relative;width:100%;"><div style="position: absolute; width:100%;">
        <ul id="main-menu" class="left">
        
        <li id=""><a target="_self" href="index.html">最近更新</a></li>
        
        <li id=""><a target="_self" href="archives.html">归档目录</a></li>
        
        <li id="ios.css"><a target="_self" href="ios.html">iOS</a></li>
        
        <li id="swift.css"><a target="_self" href="swift.html">Swift</a></li>
        
        <li id="reactnative.css"><a target="_self" href="reactnative.html">RN</a></li>
        
        <li id="js.css"><a target="_self" href="js.html">JS</a></li>
        
        <li id="shell.css"><a target="_self" href="shell.html">shell</a></li>
        
        <li id="coding.css"><a target="_self" href="coding.html">编程</a></li>
        
        <li id="live.css"><a target="_self" href="live.html">随笔</a></li>
        
        <li id="app.css"><a target="_blank" href="app.html">APP推荐</a></li>
        
        </ul>

        <ul class="right" id="search-wrap">
          <li>
<form target="_blank" onsubmit="return before_search();" action="http://google.com/search" method="get">
    <input type="hidden" id="search_q" name="q" value="" />
    <input tabindex="1" type="search" id="search_input"  placeholder="Search"/>
</form>
</li>
          </ul>
      </div></div>
  </div>
  </section>

</nav>

        <nav class="tab-bar show-for-small">
  <a href="javascript:void(0)" class="left-off-canvas-toggle menu-icon">
    <span> &nbsp; kaelinda</span>
  </a>
</nav>

<aside class="left-off-canvas-menu">
      <ul class="off-canvas-list">
        
        <li><a target="_self" href="index.html">最近更新</a></li>
        
        <li><a target="_self" href="archives.html">归档目录</a></li>
        
        <li><a target="_self" href="ios.html">iOS</a></li>
        
        <li><a target="_self" href="swift.html">Swift</a></li>
        
        <li><a target="_self" href="reactnative.html">RN</a></li>
        
        <li><a target="_self" href="js.html">JS</a></li>
        
        <li><a target="_self" href="shell.html">shell</a></li>
        
        <li><a target="_self" href="coding.html">编程</a></li>
        
        <li><a target="_self" href="live.html">随笔</a></li>
        
        <li><a target="_blank" href="app.html">APP推荐</a></li>
        

    <li><label>Categories</label></li>

        
            <li><a href="reactnative.html">React-Native</a></li>
        
            <li><a href="ios.html">iOS</a></li>
        
            <li><a href="app.html">MacAPP</a></li>
        
            <li><a href="swift.html">Swift</a></li>
        
            <li><a href="js.html">JavaScript</a></li>
        
            <li><a href="vue.html">Vue</a></li>
        
            <li><a href="shell.html">shell</a></li>
        
            <li><a href="%E7%BD%91%E7%BB%9C.html">网络</a></li>
         

      </ul>
    </aside>

<a class="exit-off-canvas" href="#"></a>


        <section id="main-content" role="main" class="scroll-container">
        
       

 <script type="text/javascript">
  $(function(){
    $('#menu_item_index').addClass('is_active');
  });
</script>
<div class="row">
  <div class="large-8 medium-8 columns">
      <div class="markdown-body article-wrap">
       <div class="article">
          
          <h1>【精选】Mac 手动内存清理教程</h1>
     
        <div class="read-more clearfix">
          <span class="date">2018/12/17</span>

          <span>posted in&nbsp;</span> 
          
              <span class="posted-in"><a href='ios.html'>iOS</a></span>
           
         
          <span class="comments">
            

            
          </span>

        </div>
      </div><!-- article -->

      <div class="article-content">
      <h2 id="toc_0">一、查看内存占用情况</h2>

<p><img src="http://upload-images.jianshu.io/upload_images/412206-4734b7ee4a571010.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image"/></p>

<h2 id="toc_1">二、管理内存</h2>

<p><img src="http://upload-images.jianshu.io/upload_images/412206-fe84152bd070aca0.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image"/></p>

<h3 id="toc_2">1、废纸篓</h3>

<p>清理非废纸篓的道理我就不废话了吧。</p>

<h3 id="toc_3">2、清理文稿</h3>

<p>按照大小排序 清理文件 优先清理大文件</p>

<p><img src="http://upload-images.jianshu.io/upload_images/412206-a28b01c486d51b60.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image"/></p>

<p>如果你是小白，清理玩这些也就差不多了。<br/>
如果你是开发者（Coder），那请您继续：</p>

<h2 id="toc_4">三、清理隐藏文件夹 中的垃圾文件</h2>

<h3 id="toc_5">1、【显示】or【隐藏】  隐藏文件夹</h3>

<ul>
<li>显示隐藏文件：</li>
</ul>

<pre><code class="language-text">defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder
</code></pre>

<ul>
<li>隐藏 隐性文件：</li>
</ul>

<pre><code class="language-text">defaults write com.apple.finder AppleShowAllFiles -boolean false ; killall Finder
</code></pre>

<h3 id="toc_6">2、超级用户的文件清理</h3>

<h4 id="toc_7">勾选☑️显示侧边栏上的磁盘 【硬盘】</h4>

<p><img src="http://upload-images.jianshu.io/upload_images/412206-d0d31f21c6f6a87a.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image"/></p>

<h4 id="toc_8">清理已卸载APP留下的痕迹</h4>

<p>这里需要注意的是，确定已卸载的，没用到的APP痕迹清理掉，不要清理多了，否则会导致部分APP失效。<br/>
比如：我想清理掉所有Adobe系列的APP 以及缓存。<br/>
<img src="http://upload-images.jianshu.io/upload_images/412206-9cac391a841fff2f.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image"/></p>

<h3 id="toc_9">1、Mac 当前用户环境清理</h3>

<p>Finder 侧边栏找到你的当前账户：<br/>
<img src="http://upload-images.jianshu.io/upload_images/412206-9e82f8b508a2fa1f.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image"/></p>

<p>如果你是安卓开发者、或者混合开发者，请看这里：</p>

<p><img src="http://upload-images.jianshu.io/upload_images/412206-a76ad6d57a292aaf.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="安卓SDK"/></p>

<p><img src="http://upload-images.jianshu.io/upload_images/412206-51d793f73aa7f519.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="安卓SDK buildTool 版本支持"/></p>

<p>SDK根据自己开发项目选择下载（如果你磁盘够用，那你可以随便下）。</p>

<p>如果你是iOS开发者请看下一条：</p>

<h3 id="toc_10">2、iOS开发者清理内容</h3>

<p><code>/Libary(资源库)/Developer</code>   文件夹下</p>

<h4 id="toc_11">清理模拟器上面安装APP的缓存文件</h4>

<p><img src="http://upload-images.jianshu.io/upload_images/412206-e72cb97e3e14504c.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="模拟器上APP的缓存文件 沙盒路径"/></p>

<h4 id="toc_12">清理打包文件缓存</h4>

<p><img src="http://upload-images.jianshu.io/upload_images/412206-a5ba95c90daab824.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="Archive 打包发布APP 的临时文件"/></p>

<h4 id="toc_13">清理支持设备系统版本</h4>

<p><img src="http://upload-images.jianshu.io/upload_images/412206-6df62dc27ca8e1dd.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="支持的模拟器的系统版本 老版本的可以删除掉了"/></p>

<h4 id="toc_14">清理老版本Xcode安装插件遗留</h4>

<p><img src="http://upload-images.jianshu.io/upload_images/412206-d1a2332e70a3eef6.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="只有Xcode老用户才会有这个吧"/></p>

<h4 id="toc_15">清理那些只安装在当前用户权限下的APP缓存</h4>

<p>在这里，通过APP的boundleID 大概的能推断出哪些是你自己可清理的APP缓存吧？</p>

<p><img src="http://upload-images.jianshu.io/upload_images/412206-24de398150dfa0e4.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="/资源库/Application Script"/></p>

<p>清理 Application Support:<br/>
这里根据自己情况看看哪些是自己不再需要的APP，遗留下来的垃圾文件，有选择性的清理下。</p>

<p><img src="https://ws1.sinaimg.cn/large/006tNbRwly1fy9owaimynj30de0c3wgg.jpg" alt="/资源库/Application Support"/></p>

<h4 id="toc_16">清理环境缓存 （比如Jenkins）</h4>

<p>如果你不想再使用Jenkins环境了（你可能还会有别的环境），那么这里可以清理掉了：<br/>
<img src="http://upload-images.jianshu.io/upload_images/412206-fac3ca55a37edcd3.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image"/></p>


    

      </div>

      <div class="row">
        <div class="large-6 columns">
        <p class="text-left" style="padding:15px 0px;">
      
          <a href="15477923365213.html" 
          title="Previous Post: iOS 获取汉字【简体中文】笔画数">&laquo; iOS 获取汉字【简体中文】笔画数</a>
      
        </p>
        </div>
        <div class="large-6 columns">
      <p class="text-right" style="padding:15px 0px;">
      
          <a  href="15397592871272.html" 
          title="Next Post: iOS 竖屏NavigationController present 到只支持横屏的界面 版本解析">iOS 竖屏NavigationController present 到只支持横屏的界面 版本解析 &raquo;</a>
      
      </p>
        </div>
      </div>
      <div class="comments-wrap">
        <div class="share-comments">
          

          

          
        </div>
      </div>
    </div><!-- article-wrap -->
  </div><!-- large 8 -->




 <div class="large-4 medium-4 columns">
  <div class="hide-for-small">
    <div id="sidebar" class="sidebar">
          <div id="site-info" class="site-info">
            
                <div class="site-a-logo"><img src="https://ws1.sinaimg.cn/large/006tNc79ly1fmpk9088gsj30sg0sgn33.jpg" /></div>
            
                <h1>kaelinda</h1>
                <div class="site-des">倘若我心中的山水，你眼中能看到，我便一步一莲花祈祷</div>
                <div class="social">








<a target="_blank" class="twitter" target="_blank" href="https://twitter.com/KaelLVLinda" title="Twitter">Twitter</a>
<a target="_blank" class="github" target="_blank" href="https://github.com/Kaelzzs" title="GitHub">GitHub</a>
<a target="_blank" class="email" href="mailto:zhouzuosong_kael@163.com" title="Email">Email</a>
  <a target="_blank" class="rss" href="atom.xml" title="RSS">RSS</a>
                
              	 </div>
          	</div>

             

              <div id="site-categories" class="side-item ">
                <div class="side-header">
                  <h2>Categories</h2>
                </div>
                <div class="side-content">

      	<p class="cat-list">
        
            <a href="reactnative.html"><strong>React-Native</strong></a>
        
            <a href="ios.html"><strong>iOS</strong></a>
        
            <a href="app.html"><strong>MacAPP</strong></a>
        
            <a href="swift.html"><strong>Swift</strong></a>
        
            <a href="js.html"><strong>JavaScript</strong></a>
        
            <a href="vue.html"><strong>Vue</strong></a>
        
            <a href="shell.html"><strong>shell</strong></a>
        
            <a href="%E7%BD%91%E7%BB%9C.html"><strong>网络</strong></a>
         
        </p>


                </div>
              </div>

              <div id="site-categories" class="side-item">
                <div class="side-header">
                  <h2>Recent Posts</h2>
                </div>
                <div class="side-content">
                <ul class="posts-list">
	      
		      
			      <li class="post">
			        <a href="15523077857608.html">OC中枚举写法  以及 字符串枚举探索</a>
			      </li>
		     
		  
		      
			      <li class="post">
			        <a href="15522686353535.html">iOS 动画全解 (1)</a>
			      </li>
		     
		  
		      
			      <li class="post">
			        <a href="15501356584731.html">UITableView顶部空白的几种解决办法</a>
			      </li>
		     
		  
		      
			      <li class="post">
			        <a href="15488351784332.html">Objective-C中的字符串类型枚举 探索</a>
			      </li>
		     
		  
		      
			      <li class="post">
			        <a href="15409691048860.html">【Swift笔记】引用计数</a>
			      </li>
		     
		  
		      
		  
		      
		  
		      
		  
		      
		  
		      
		  
		      
		  
		      
		  
		      
		  
		      
		  
		      
		  
		      
		  
		      
		  
		      
		  
		      
		  
		      
		   
		  		</ul>
                </div>
              </div>
        </div><!-- sidebar -->
      </div><!-- hide for small -->
</div><!-- large 4 -->

</div><!-- row -->

 <div class="page-bottom clearfix">
  <div class="row">
   <p class="copyright">Copyright &copy; 2015
Powered by <a target="_blank" href="http://www.mweb.im">MWeb</a>,&nbsp; 
Theme used <a target="_blank" href="http://github.com">GitHub CSS</a>.</p>
  </div>
</div>

        </section>
      </div>
    </div>

  
    

    <script src="asset/js/foundation.min.js"></script>
    <script>
      $(document).foundation();
      function fixSidebarHeight(){
        var w1 = $('.markdown-body').height();
          var w2 = $('#sidebar').height();
          if (w1 > w2) { $('#sidebar').height(w1); };
      }
      $(function(){
        fixSidebarHeight();
      })
      $(window).load(function(){
          fixSidebarHeight();
      });
     
    </script>

    
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><script type="text/x-mathjax-config">MathJax.Hub.Config({TeX: { equationNumbers: { autoNumber: "AMS" } }});</script>


  </body>
</html>
